package com.sure.classsystemserver.classroom.query;

import com.sure.classsystemserver.common.CommonService;
import com.sure.classsystemserver.common.CurrentUser;
import com.sure.classsystemserver.common.Result;
import com.sure.classsystemserver.common.TokenUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/classroom/query")
public class QueryAPI {

    @Resource
    private QueryService queryService;

    @Resource
    private CommonService commonService;

    @GetMapping("")
    public Result flowrateList(QueryDto queryDto) {
        List<Number> numberList = queryService.findNumberList(queryDto);
        return Result.success(numberList);
    }

    @GetMapping("/classroomList")
    public Result addressList() {
        List<Classroom> classroomList = queryService.findClassroomList();
        return Result.success(classroomList);
    }

    @GetMapping("/fl")
    public Result fflowrateList(QueryDto queryDto) {
        Map<String, Object> page = queryService.findFlowrateList(queryDto);
        return Result.success(page);
    }
}
